<?php

namespace App\Http\Controllers\Api;

use Illuminate\Http\Request;

use App\Http\Requests;
use App\Http\Controllers\Controller;
use App\Repositories\UserRepo;

class UserController extends ApiBaseController
{
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function info()
    {
        $user_id = $this->getUserId();
        $userRepo = new UserRepo();

        return $this->sucRes(200,['userInfo'=>$userRepo->getUser($user_id)]);
    }

    public function bind(Request $request)
    {
        $user_id = $this->getUserId();
        $mobile = $request->param('mobile');
        $userRepo = new UserRepo();
        $userRepo->bindMobile($user_id,$mobile);
        return $this->sucRes(200);
    }
}
